#!/usr/bin/env python
# -*- coding: utf-8 -*-

from selenium import webdriver


class EdgeDriverConfig:
    def driver_config(self, root_path='./'):
        """
        浏览器驱动
        :return:
        """
        # 调用环境变量指定的PhantomJS浏览器创建浏览器对象
        driver = webdriver.PhantomJS()
        # 如果没有在环境变量指定PhantomJS位置
        driver = webdriver.PhantomJS(executable_path=root_path + "driver/phantomjs.exe")
        # 删除所有cookies
        driver.delete_all_cookies()
        # 设置为全屏模式
        driver.maximize_window()
        return driver
